Add Omega horizontal pressure gradient tests#465
Add Omega horizontal pressure gradient tests#465xylar wants to merge 53 commits intoE3SM-Project:mainfrom
Conversation
|
This is build off of #464 so I will hold off a bit on asking for reviews and rebase once that (hopefully) goes in. |
|
This needs to be updated to not use the |
c5259f4 to
5edaee3
Compare
For now, just creates initial conditions in each column, including specific volume.
The vertical coordinate is z-tilde, but the z-tilde at the sea floor has to be found iteratively such that the geometric water-column thickness is as expected
The init steps support a sequence of resolutions for a convergence test.
At least for now, it will be too confusing to have this capability in the ocean component's framework since it is used for verification only.
Also, switch to a more realistic CT and SA profile.
Fix some confusing references to z-levels
We can't compare the Omega and reference solutions too close to the bathymetry because the reference solution isn't good enough (4th-order gradient breaks down) and doesn't have data at the same locations as the Omega solution.
The analysis fails if errors exceed the thresholds or if the convergence rate is outside the expected range.
Limit the convergence analysis to 6 km and higher. Add absolute error threshold for situations where the HPGA is too small for the normalize error to be useful.
Add 0.5 km resolution and lower convergence fit to <= 4 km. Switch reference solution to higher res (0.25 km). Adjust convergence thresholds.
This makes the problem more numerically challenging.
Drop coarsest resolutions (16, 8, 6 km) and add more fine resolutions (1.5 and 0.75 km).
5edaee3 to
a385f6b
Compare
|
Updated
|
|
@xylar Thanks for pointing that out. Sounds good |
|
I'll add the submodule update tomorrow. Sorry I forgot to do that today. |
|
|
||
|
|
||
| class Reference(OceanIOStep): | ||
| r""" |
There was a problem hiding this comment.
| r""" | |
| """ |
There was a problem hiding this comment.
I'll check on this. There may be a math reason this needs to be a literal string rather than decoding the back-slashes.
| - Omega RMS error versus reference (`omega_vs_reference.png`), including a | ||
| power-law fit and convergence slope, and | ||
| - Omega RMS difference versus Python initialization (`omega_vs_python.png`). |
There was a problem hiding this comment.
Can we provide more detail here to explain exactly what we're evaluating against? It's not immediately apparent to me why, in order to evaluate the pressure gradient tendency at the midpoint of edges given the T,S,layerThickness fields at the midpoint of cells, we choose as "truth" a 4th-order reconstruction given T,S,dTdx,dSdx at the midpoint of edges (not sure that I got all these details right, just trying to be specific about what details would be helpful). I realize that some of this info might be in the design doc but I think it would be good to include here or in the description section.
There was a problem hiding this comment.
Noted. I will try to do a better job of documenting this.
This merge adds three
horiz_press_gradtests for the horizontal pressure-gradient acceleration (HPGA) in Omega:salinity_gradient- salinity varies horizontally; temperature varies only with depth and layer pseudo-thicknesses are uniformtemperature_gradient- temperature varies horizontally; salinity varies only with depth and layer pseudo-thicknesses are uniformztilde_gradient- pseudo-height of layers are sloped; temperature and salinity vary only with depth (thus, HPGA should be close to zero)The tests include :
referencestep that computes a high-fidelity reference solution (numerical quadrature in the vertical; a 4th-order gradient in the horizontal)initsteps at each of a list of horizontal and vertical resolutions that provide initial conditions and a Python implementation of the centered, 2nd-order HPGAforwardsteps at each resolution that just computes the HPGA (inNormalVelocityTend) in Omegaanalysisstep that checks the RMS difference between the Omega and Polaris centered HPGA (verification of the implementation) and plots the convergence of the HPGA with respect to the reference solution. Errors are raised if the Omega solution diverges too much from the Python implementation at any resolution or from the reference solution at the highest resolution. An error is also raised if the convergence rate is too poor.Checklist
api.md) has any new or modified class, method and/or functions listedTestingcomment in the PR documents testing used to verify the changes